home *** CD-ROM | disk | FTP | other *** search
/ Merciful 1 / Merciful - Disc 1.iso / software / t / thinker_ii / thinkerii.dms / in.adf / changeall.thnkr < prev    next >
Encoding:
Text File  |  1989-11-15  |  779 b   |  26 lines

  1. /******************************************************************
  2. *                                                                 *
  3. *  Macro to change all occurrences of a string to a second string *
  4. *                                                                 *
  5. ******************************************************************/
  6. trace off
  7. options results
  8. parse arg source destination .
  9. if source = '' then do
  10.    'input Enter search string'
  11.    source=result
  12. end
  13. if result = '' then exit 1 /* changes mind */
  14. if destination = '' then do
  15.    'input Enter replacement string'
  16.    destination=result
  17. end
  18. 'search first' source
  19. if rc = 0 then do
  20.    'search replace' destination
  21.    do while rc=0
  22.        'search next'
  23.        if rc=0 then 'search replace' destination
  24.    end
  25.  end
  26.